import http from '../../http/http'
const state = {
    user: {
        name: 'zhangsan'
    },
    tableData:[],
    tableData2:[],
    tableData3:[],
    tableData4:[],
}
const actions = {
    mmm({commit}){
        http({
          url:'/mgrsite/Account/selectAllInfo',
          method:'post',
        }).then(res =>{
          if(res.status == 200){
              commit('getAllInfo',res.data)
          }
          return res.data
        }).catch(err => {
          console.log(err)
        })
    },
    // /mgrsite/Account/queryStaff
    getStaff({commit}){
        http({
            url:'/mgrsite/Account/queryStaff',
            method:'post',
        }).then(res =>{
            if(res.status == 200){
                commit('getStaffData',res.data)
            }
            return res.data
        }).catch(err =>{
            console.log(err)
        })
    },
    getLogAll({commit}){
        http({               //查询日志ajax
            url:'/mgrsite/SAdmin/selectOperationLogAll',
            method:'post',
            }).then(res =>{
                if(res.status == 200){
                    commit('getLogAll',res.data)
                }
                return res.data
            })
            .catch(err =>{
              console.log(err)
//
            })
    }
}
const mutations = {
    getAllInfo(state,data){
        state.tableData = data
    },
    getStaffData(state,data){
        state.tableData2 = data
    },
    getLogAll(state,data){
        state.tableData3 = data
    }
}
const getters = {}
export default {
    state,
    actions,
    mutations,
    getters
}